Repository navigation
fix(ci): add common::yq_inplace for flavor-safe yq edits - #5978
Conversation
The IDMS patching used mikefarah-only syntax (yq eval -i), which hard-fails under the python jq-wrapper yq, and its read guard silently fails there too (no eval subcommand), which would add duplicate mirror entries. Route writes through a local disconnected::yq_inplace helper (bare -i on mikefarah, --yaml-roundtrip --in-place on python yq) and drop eval from the read guards so bare yq '<expr>' works on both flavors. Verified against mikefarah v4.54.3 and python yq 3.4.3. Related Jira: RHIDP-9953 Assisted-By: paseo (pi + GLM 5.3 (EnMaaS), thinking: high) Signed-off-by: Nick Boldt <nboldt@redhat.com>
|
Pipeline controller notification This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration. Use |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5978 +/- ##
==========================================
- Coverage 82.04% 78.41% -3.64%
==========================================
Files 71 64 -7
Lines 908 755 -153
Branches 139 122 -17
==========================================
- Hits 745 592 -153
Misses 162 162
Partials 1 1
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Per review: the helper now lives as common::yq_inplace in .ci/pipelines/lib/common.sh, so every utils.sh / disconnected.sh consumer can reuse it instead of a mirror.sh-local copy. Load order guarantees availability: disconnected.sh sources common.sh before the disconnected modules. Related Jira: RHIDP-9953 Assisted-By: paseo (pi + GLM 5.3 (EnMaaS), thinking: high) Signed-off-by: Nick Boldt <nboldt@redhat.com>
gustavolira
left a comment
There was a problem hiding this comment.
Nit: PR description still says disconnected::yq_inplace.
common::yq_inplace signature is now $1 = expression, $2 = file, with python-yq-only extra flags as optional $3 (call sites drop the empty string), the empty-arg expansion is gone (array build, no SC2086 disable), and the Hooks banner comment block in mirror.sh is restored. Related Jira: RHIDP-9953 Assisted-By: paseo (pi + GLM 5.3 (EnMaaS), thinking: high) Signed-off-by: Nick Boldt <nboldt@redhat.com>
macOS /bin/bash 3.2 fails on an empty "${py_args[@]}" under set -u;
guard the expansion with ${py_args[@]+"${py_args[@]}"} per review.
Related Jira: RHIDP-9953
Assisted-By: paseo (pi + GLM 5.3 (EnMaaS), thinking: high)
Signed-off-by: Nick Boldt <nboldt@redhat.com>
|
|
Nit addressed: title and description now reflect the final shape — |
|
Scheduling tests matching the |



Summary
common::yq_inplaceto.ci/pipelines/lib/common.sh— an in-place yq edit that works with both yq flavors: mikefarah yq (the disconnected pipeline image default: bare--in-place) and the python jq-wrapper yq (developer environments on Mac/Linux:--in-placerequires an output format, and it has noevalsubcommand)..ci/pipelines/lib/disconnected/mirror.shto use it. The oldyq eval -ihard-failed under python yq, and the old read guard (yq eval '.spec.imageDigestMirrors[].source') failed silently there — which would have added duplicate IDMS entries before the write errored. Reads now use bareyq '<expr>', valid on both flavors.$1 = expression, $2 = file, $3 = optional python-yq-only extra flags(array-built, bash-3.2-safe empty expansion underset -u).Mirrors the midstream twin in
build/scripts/utils.sh(rhidp/rhdh !947) — deliberately duplicated rather than sourced across repos: the synced distgit copy can lag upstream, and the sync machinery shouldn't depend on the tree it syncs.Related Jira: RHIDP-9953